package firstTestHomework;

public class Trim {

	public static void main(String[] args) {
		String str = "   java Android  ";
		char[] array = str.toCharArray();
		int start = 0;
		int end = array.length;
		int i = 0;
		//int[] cout = new int[2];
		for(i = 0; i < array.length; i++) {
			if(array[i] == ' ') {
				start++;
			}else  {
				break;
			}
		}
		
		for(i = 0; i < array.length; i++) {
			if(array.length - 1 - i == ' ') {
				end--;
			}else {
				break;
			}
		}

		
				System.out.println(str.substring(start, end)); 
	}
}
